package com.woniuxy.yoga.admin.dao.mapper;

import com.woniuxy.yoga.admin.dao.model.Menu;
import com.woniuxy.yoga.admin.dao.model.Resource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;

/**
 * <p>
 * 资源表 Mapper 接口
 * </p>
 *
 * @author 韦用文,刘存益,郎腾霄
 * @since 2023年11月28日
 */
@Mapper
public interface ResourceMapper extends BaseMapper<Resource> {

    /**
     * 插入资源信息 将主键信息赋值给参数对象上
     * @param resource
     * @return
     */
    @Insert("insert into resource values(null,#{resourcePath},#{resourceName})")
    @Options(useGeneratedKeys = true,keyProperty = "resourceId",keyColumn = "resource_id")
    Integer insertResource(Resource resource);

}
